<%-- 
    Document   : categorymovieslist
    Created on : Jul 27, 2012, 2:22:55 AM
    Author     : Atienza-Home
--%>
<%@page import="java.util.Iterator"%>
<%@page import="Factory.Tables.Movie"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Factory.Tables.Category"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<div style="width: 50%;float: left; ">
<%
 
    ArrayList<Movie> result = (ArrayList<Movie>)session.getAttribute("movielist");
    Iterator<Movie> iter;
    Movie movie;
    Category category= (Category)session.getAttribute("chosencategory");


if(category.getCategoryPic()==null){
%>
<img src="images/category/categorynopic.png" width="30px" />

<%
}
else{
%>
    <img src="images/category/<%=category.getCategoryPic()%>" />
<%
}
%>
<font size="6px" color="white"><%=category.getCategoryName()%></font>
<font color="white" style=" padding:5px;font-style: italic;">"<%=category.getCategoryDescription() %>"</font>
</div>

<div style="width: 50%;float: left; text-align: right;">
<font color="white">Select Filter:</font>
<select>
    <option>Newest</option>
    <option>Top Rated</option>
    <option>Most Viewed</option>
</select>
</div>


<br><br><br><br>


<div class="specificmovielist" style="width: 870px;margin:auto;">
    
    <%
    if(result!=null){
            iter = result.iterator(); 
            while(iter.hasNext()){
                movie = iter.next();
                
                %>
                
                <div id="movielist"  style="border:15px solid #006666;height: 303px;">
                    <div id="moviepic<%=movie.getId()%>" style="float:left;">
                        <img src="images/movie/<%=movie.getMoviePic()%>" style="width:208px;height: 303px;" >
                    </div>
                    <div id="moviedetails<%=movie.getId()%>" style="float:left;width: 592px;background-color: gray;height: 263px;padding: 20px" >
                        <font color="white" size="5px" style="font-family: arial"><%=movie.getName()%></font><br><br>
                        <font color="white">&nbsp;&nbsp;&nbsp;<%=movie.getDescription()%></font><br><br>
                        <font color="white">Release Date: <%=movie.getReleaseDate()%></font><br>
                        <font color="white">Rating: <%=movie.getRating()%></font><br>
                        <%
                        if(movie.getInventoryQuantity()<=10&&movie.getInventoryQuantity()>0){
                            
                        %>
                            <font color="#cc6666">Hurry while supplies last!</font>
                        <%                          
                        }else if(movie.getInventoryQuantity()==0){
                        %>
                            <font color="#cc6666">Out of stock!</font>
                        <%
                        }
                        %>
                        
                        
                        <div style="width:592px; text-align: right;">
                            <font color="white"><a href="movie.jsp?id=<%=movie.getId() %>" style="color:white;" >See more!</a></font>
                            
                        </div>
                        
                        
                        
                        
                        
                        
                    </div>
                </div>
                
                
                <%
                
                
            }
     }
    
    
    %>
    
    
</div>
